import request from '@/utils/request.js'

export const userRegsterService=(registerData)=>{
    const params=new URLSearchParams();
    console.log(registerData);
    for (let key in registerData){
        
        params.append(key,registerData[key]);

    }
    
    return request.post('/user/register',params);


}

export const userLoginService=(LoginData)=>{
    const p= new URLSearchParams()
    for (let key in LoginData){
        p.append(key,LoginData[key]);
    }
    return request.post('/user/login',p)
}

//详细信息
export const userInfoService=()=>{
    return request.get('user/userInfo')
}


export const userInfoUpdateService=(userInfoData)=>{
    return request.put('/user/update',userInfoData)
}

export const userAvatarUpdateService=(avatarUrl)=>{
    const params=new URLSearchParams();
    params.append('avatarUrl',avatarUrl)
    return request.patch('/user/updateAvatar',params)
}
